import { AppBaseEntity } from 'src/shared/database/baseEntity';
import { Column, Entity } from 'typeorm';
import { Role as RoleEnum } from './role.enum';

@Entity({
  name: 'roles',
  comment: '用户角色表',
})
export class RoleEntity extends AppBaseEntity {
  @Column({
    name: 'role',
    comment: '用户角色',
    type: 'enum',
    enum: RoleEnum,
    default: RoleEnum.USER,
  })
  role: RoleEnum;

  @Column({
    name: 'user_id',
    comment: '用户id',
    type: 'int',
  })
  userId: number;

  @Column({
    name: 'tenant_id',
    comment: '商户id',
  })
  tenantId: number;
}
